<template>
  <div>
    <el-tabs type="border-card">
      <el-tab-pane label="菜品管理">
        <div class="playerinformation" id="dishManageDiv">
          <el-form label-width="80px" class="searchform">
            <el-form-item label="菜品名称:">
              <el-input
                v-model="searchForm.dishName"
                placeholder="请输入名称"
              ></el-input>
            </el-form-item>
            <el-form-item label="类型:">
              <el-select
                v-model="searchForm.dishTypeName"
                placeholder="请选择类型"
              >
                <el-option
                  v-for="item in dishTypeOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-form>
          <el-button type="primary" @click="search()">查询</el-button>
          <el-button type="primary" @click="addDishDialogFormVisible = true"
            >添加</el-button
          >

          <el-table
            :data="dishTable"
            stripe=""
            border
            fit
            style="width: 100%"
            :header-cell-style="{ textAlign: 'center' }"
            :cell-style="{ textAlign: 'center' }"
          >
            <el-table-column type="index" label="序号"> </el-table-column>
            <el-table-column prop="id" label="菜品编号"> </el-table-column>
            <el-table-column prop="dishName" label="菜品名称">
            </el-table-column>
            <el-table-column prop="typeName" label="菜品类型">
            </el-table-column>
            <el-table-column fixed="right" align="center" label="操作">
              <template slot-scope="scope">
                <el-button type="text" size="small" @click="editDish(scope.row)"
                  >编辑</el-button
                >
                <el-button type="text" size="small" @click="del(scope.row)"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>

          <!-- 分页 -->
          <div style="text-align: right">
            <el-pagination background layout="prev, pager, next" :total="1000">
            </el-pagination>
          </div>

          <el-dialog
            title="添加菜品"
            :visible.sync="addDishDialogFormVisible"
            width="400px"
          >
            <el-form
              :model="addDishForm"
              :rules="rules"
              ref="addDishForm"
              label-width="100px"
              class="demo-ruleForm"
            >
              <el-form-item label="菜品名称:" prop="dishName">
                <el-input
                  v-model="addDishForm.dishName"
                  placeholder="请输入名称"
                ></el-input>
              </el-form-item>
              <el-form-item label="类型:" prop="dishTypeName">
                <el-select
                  v-model="addDishForm.typeName"
                  placeholder="请选择类型"
                >
                  <el-option
                    v-for="item in dishTypeOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>

              <el-form-item>
                <el-button type="primary" @click="submitForm('addDishForm')"
                  >确认</el-button
                >
                <el-button @click="resetForm('addDishForm')">重置</el-button>
              </el-form-item>
            </el-form>

            <!-- <div slot="footer" class="dialog-footer">
			<el-button @click="dialogFormVisible = false">取 消</el-button>
			<el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
		</div> -->
          </el-dialog>

          <el-dialog
            title="修改菜品信息"
            :visible.sync="editDishDialogVisible"
            width="400px"
          >
            <el-form
              :model="editDishForm"
              :rules="rules"
              ref="editDishForm"
              label-width="100px"
              class="demo-ruleForm"
            >
              <el-form-item hidden>
                <el-input v-model="editDishForm.id"></el-input>
              </el-form-item>
              <el-form-item label="菜品名称:" prop="dishName">
                <el-input
                  v-model="editDishForm.dishName"
                  placeholder="请输入名称"
                ></el-input>
              </el-form-item>
              <el-form-item label="类型:" prop="dishTypeName">
                <el-select
                  v-model="editDishForm.typeName"
                  placeholder="请选择类型"
                >
                  <el-option
                    v-for="item in dishTypeOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>

              <el-form-item>
                <el-button type="primary" @click="submitForm('editDishForm')"
                  >确认</el-button
                >
                <el-button @click="resetForm('editDishForm')">重置</el-button>
              </el-form-item>
            </el-form>
          </el-dialog>
        </div>
      </el-tab-pane>
      <!-- ----------------------------------------------------------------------------------------------------- -->
      <el-tab-pane label="菜谱管理">
        <div class="playerinformation" id="menuManageDiv">
          <el-form label-width="80px" class="searchform">
            <el-form-item label="上菜日期">
              <el-col :span="20">
                <el-form-item>
                  <el-date-picker
                    type="date"
                    placeholder="选择日期"
                    v-model="searchForm.menuDate1"
                    format="yyyy-MM-dd" 
                    value-format="yyyy-MM-dd"
                    style="width: 100%"
                  ></el-date-picker>
                </el-form-item>
              </el-col>
            </el-form-item>
          </el-form>
          <el-button type="primary" @click="search()">查询</el-button>
          <!-- <el-button type="primary" @click="addMenuDialogFormVisible = true"
            >添加</el-button
          > -->

          <el-table
            :data="menuTable"
            stripe=""
            border
            fit
            style="width: 100%"
            :header-cell-style="{ textAlign: 'center' }"
            :cell-style="{ textAlign: 'center' }"
          >
           <el-table-column prop="date" label="日期" width="130px">
              
            </el-table-column>
          <el-table-column prop="week" label="星期" width="130px"> 
          </el-table-column>
<el-table-column prop="zao" label="早餐" width="280px">

</el-table-column>
<el-table-column prop="zhong" label="中餐" width="280px">
  
</el-table-column>
<el-table-column prop="wan" label="晚餐" width="280px">
  
</el-table-column>
          
            
            
          </el-table>

          <!-- 分页 -->
          <div style="text-align: right">
            <el-pagination background layout="prev, pager, next" :current-page="pageNum"
			@current-change="changePageNum" :total="pages">
            </el-pagination>
          </div>

          <!-- 添加菜谱的表单 -->
          <el-dialog
            title="添加菜谱"
            :visible.sync="addMenuDialogFormVisible"
            width="400px"
          >
            <el-form
              :model="addMenuForm"
              :rules="rules"
              ref="addMenuForm"
              label-width="100px"
              class="demo-ruleForm"
            >
              <el-form-item label="菜谱日期">
                <el-col :span="11">
                  <el-form-item prop="date">
                    <el-date-picker
                      type="date"
                      placeholder="选择日期"
                      v-model="addMenuForm.date"
                      style="width: 200px"
                    ></el-date-picker>
                  </el-form-item>
                </el-col>
              </el-form-item>
              <el-form-item label="选择早餐菜品" prop="type">
                <el-checkbox-group v-model="zaoCans">
                  <el-checkbox label="绿豆粥" name="type"></el-checkbox>
                  <el-checkbox label="红豆粥" name="type"></el-checkbox>
                  <el-checkbox label="八宝粥" name="type"></el-checkbox>
                  <el-checkbox label="牛奶" name="type"></el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item label="选择中餐菜品" prop="type">
                <el-checkbox-group v-model="zhongCans">
                  <el-checkbox label="绿豆粥" name="type"></el-checkbox>
                  <el-checkbox label="红豆粥" name="type"></el-checkbox>
                  <el-checkbox label="八宝粥" name="type"></el-checkbox>
                  <el-checkbox label="牛奶" name="type"></el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item label="选择晚餐菜品" prop="type">
                <el-checkbox-group v-model="wanCans">
                  <el-checkbox label="绿豆粥" name="type"></el-checkbox>
                  <el-checkbox label="红豆粥" name="type"></el-checkbox>
                  <el-checkbox label="八宝粥" name="type"></el-checkbox>
                  <el-checkbox label="牛奶" name="type"></el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="submitForm('addDishForm')"
                  >确认</el-button
                >
                <el-button @click="resetForm('addDishForm')">重置</el-button>
              </el-form-item>
            </el-form>

            <!-- <div slot="footer" class="dialog-footer">
			<el-button @click="dialogFormVisible = false">取 消</el-button>
			<el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
		</div> -->
          </el-dialog>

          <!-- 修改菜谱的表单 -->
          <el-dialog
            title="修改早餐信息"
            :visible.sync="editMenuDialogVisible1"
            width="400px"
          >
            <el-form
              :model="editMenuForm"
              :rules="rules"
              ref="editMenuForm"
              label-width="100px"
              class="demo-ruleForm"
            >
              <el-form-item hidden>
                <el-input v-model="editMenuForm.zaoCanId"></el-input>
              </el-form-item>
              <el-form-item label="选择菜品" prop="type">
                <el-checkbox-group v-model="zaoCans">
                  <el-checkbox label="绿豆粥" name="type"></el-checkbox>
                  <el-checkbox label="红豆粥" name="type"></el-checkbox>
                  <el-checkbox label="八宝粥" name="type"></el-checkbox>
                  <el-checkbox label="牛奶" name="type"></el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="submitForm('editMenuForm')"
                  >确认</el-button
                >
                <el-button @click="resetForm('editMenuForm')">重置</el-button>
              </el-form-item>
            </el-form>
          </el-dialog>
          <el-dialog
            title="修改中餐信息"
            :visible.sync="editMenuDialogVisible2"
            width="400px"
          >
            <el-form
              :model="editMenuForm"
              :rules="rules"
              ref="editMenuForm"
              label-width="100px"
              class="demo-ruleForm"
            >
              <el-form-item hidden>
                <el-input v-model="editMenuForm.zaoCanId"></el-input>
              </el-form-item>
              <el-form-item label="选择菜品" prop="type">
                <el-checkbox-group v-model="zhongCans">
                  <el-checkbox label="绿豆粥" name="type"></el-checkbox>
                  <el-checkbox label="红豆粥" name="type"></el-checkbox>
                  <el-checkbox label="八宝粥" name="type"></el-checkbox>
                  <el-checkbox label="牛奶" name="type"></el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="submitForm('editMenuForm')"
                  >确认</el-button
                >
                <el-button @click="resetForm('editMenuForm')">重置</el-button>
              </el-form-item>
            </el-form>
          </el-dialog>
          <el-dialog
            title="修改晚餐信息"
            :visible.sync="editMenuDialogVisible3"
            width="400px"
          >
            <el-form
              :model="editMenuForm"
              :rules="rules"
              ref="editMenuForm"
              label-width="100px"
              class="demo-ruleForm"
            >
              <el-form-item hidden>
                <el-input v-model="editMenuForm.zaoCanId"></el-input>
              </el-form-item>
              <el-form-item label="选择菜品" prop="type">
                <el-checkbox-group v-model="wanCans">
                  <el-checkbox label="绿豆粥" name="type"></el-checkbox>
                  <el-checkbox label="红豆粥" name="type"></el-checkbox>
                  <el-checkbox label="八宝粥" name="type"></el-checkbox>
                  <el-checkbox label="牛奶" name="type"></el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="submitForm('editMenuForm')"
                  >确认</el-button
                >
                <el-button @click="resetForm('editMenuForm')">重置</el-button>
              </el-form-item>
            </el-form>
          </el-dialog>
        </div>
      </el-tab-pane>
      <!-- ----------------------------------------------------------------------------------------------------- -->
      <el-tab-pane label="未来一周菜谱">
        <div class="playerinformation" id="menuManageDiv">
          <el-table
            :data="menuTable"
            stripe=""
            border
            fit
            style="width: 100%"
            :header-cell-style="{ textAlign: 'center' }"
            :cell-style="{ textAlign: 'center' }"
          >
            <el-table-column prop="date" label="日期" width="130px">
            </el-table-column>
            <el-table-column prop="day" label="星期" width="110px">
            </el-table-column>
            <el-table-column prop="zaoCan" label="早餐"> 
              {{zaoCan}}
            </el-table-column>
            <el-table-column prop="zaoCanId" label="早餐菜谱id" v-if="false">
            </el-table-column>
            <el-table-column align="center" label="操作" width="70px">
              <template slot-scope="scope">
                <el-button
                  type="text"
                  size="small"
                  @click="editZaoMenu(scope.row)"
                  style="margin: 0"
                  >编辑</el-button
                >
              </template>
            </el-table-column>
            <el-table-column prop="zhongCan" label="中餐"> </el-table-column>
            <el-table-column prop="zhongCanId" label="中餐菜谱id" v-if="false">
            </el-table-column>
            <el-table-column align="center" label="操作" width="70px">
              <template slot-scope="scope">
                <el-button
                  type="text"
                  size="small"
                  @click="editZhongMenu(scope.row)"
                  style="margin: 0"
                  >编辑</el-button
                >
              </template>
            </el-table-column>
            <el-table-column prop="wanCan" label="晚餐"> </el-table-column>
            <el-table-column prop="wanCanId" label="晚餐菜谱id" v-if="false">
            </el-table-column>
            <el-table-column align="center" label="操作" width="70px">
              <template slot-scope="scope">
                <el-button
                  type="text"
                  size="small"
                  @click="editWanMenu(scope.row)"
                  style="margin: 0"
                  >编辑</el-button
                >
              </template>
            </el-table-column>
            <!-- <el-table-column fixed="right" align="center" label="操作" width="70px">
              <template slot-scope="scope">
                <el-button type="text" size="small" @click="delMenu(scope.row)"
                  >删除</el-button
                >
              </template>
            </el-table-column> -->
          </el-table>

          <!-- 分页 -->
          <div v-if="progress == 0" style="text-align: reft; margin: 10px">
            <v-text>需要原材料：</v-text>
            <el-button @click="Submit_application()" type="primary" round
              >提交申请</el-button
            >
          </div>
          <div style="text-align: reft">
            <el-row>
              <el-col :span="24"
                ><div v-if="showtijiao" class="grid-content bg-purple-dark">
                  提交状态：{{ tijiao }}
                </div></el-col
              >
            </el-row>
          </div>

          <div v-if="progress == 1" style="text-align: reft; margin: 10px">
            <el-button @click="Submit_recipe()" type="primary" round
              >提交菜谱</el-button
            >
          </div>
          <!-- 添加菜谱的表单 -->
          <el-dialog
            title="添加菜谱"
            :visible.sync="addMenuDialogFormVisible"
            width="400px"
          >
            <el-form
              :model="addMenuForm"
              :rules="rules"
              ref="addMenuForm"
              label-width="100px"
              class="demo-ruleForm"
            >
              <el-form-item label="菜谱日期">
                <el-col :span="11">
                  <el-form-item prop="date">
                    <el-date-picker
                      type="date"
                      placeholder="选择日期"
                      v-model="addMenuForm.date"
                      style="width: 200px"
                    ></el-date-picker>
                  </el-form-item>
                </el-col>
              </el-form-item>
              <el-form-item label="选择早餐菜品" prop="type">
                <el-checkbox-group v-model="zaoCans">
                  <el-checkbox label="绿豆粥" name="type"></el-checkbox>
                  <el-checkbox label="红豆粥" name="type"></el-checkbox>
                  <el-checkbox label="八宝粥" name="type"></el-checkbox>
                  <el-checkbox label="牛奶" name="type"></el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item label="选择中餐菜品" prop="type">
                <el-checkbox-group v-model="zhongCans">
                  <el-checkbox label="绿豆粥" name="type"></el-checkbox>
                  <el-checkbox label="红豆粥" name="type"></el-checkbox>
                  <el-checkbox label="八宝粥" name="type"></el-checkbox>
                  <el-checkbox label="牛奶" name="type"></el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item label="选择晚餐菜品" prop="type">
                <el-checkbox-group v-model="wanCans">
                  <el-checkbox label="绿豆粥" name="type"></el-checkbox>
                  <el-checkbox label="红豆粥" name="type"></el-checkbox>
                  <el-checkbox label="八宝粥" name="type"></el-checkbox>
                  <el-checkbox label="牛奶" name="type"></el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="submitForm('addDishForm')"
                  >确认</el-button
                >
                <el-button @click="resetForm('addDishForm')">重置</el-button>
              </el-form-item>
            </el-form>

            <!-- <div slot="footer" class="dialog-footer">
			<el-button @click="dialogFormVisible = false">取 消</el-button>
			<el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
		</div> -->
          </el-dialog>

          <!-- 修改菜谱的表单 -->
          <el-dialog
            title="修改早餐信息"
            :visible.sync="editMenuDialogVisible1"
            width="400px"
          >
            <el-form
              :model="editMenuForm"
              :rules="rules"
              ref="editMenuForm"
              label-width="100px"
              class="demo-ruleForm"
            >
              <el-form-item hidden>
                <el-input v-model="editMenuForm.zaoCanId"></el-input>
              </el-form-item>
              <el-form-item label="选择菜品" prop="type">
               
                 <el-select v-model="zaoCan" multiple placeholder="请选择">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      
      :value="item.value">
    </el-option>
  </el-select>

              
              </el-form-item>
              <!-- <el-form-item>
                <el-button type="primary" @click="submitForm('editMenuForm')"
                  >确认</el-button
                >
                <el-button @click="resetForm('editMenuForm')">重置</el-button>
              </el-form-item> -->
            </el-form>
          </el-dialog>
          <el-dialog
            title="修改中餐信息"
            :visible.sync="editMenuDialogVisible2"
            width="400px"
          >
            <el-form
              :model="editMenuForm"
              :rules="rules"
              ref="editMenuForm"
              label-width="100px"
              class="demo-ruleForm"
            >
              <el-form-item hidden>
                <el-input v-model="editMenuForm.zaoCanId"></el-input>
              </el-form-item>
              <el-form-item label="选择菜品" prop="type">
                <el-checkbox-group v-model="zhongCans">
                  <el-checkbox label="绿豆粥" name="type"></el-checkbox>
                  <el-checkbox label="红豆粥" name="type"></el-checkbox>
                  <el-checkbox label="八宝粥" name="type"></el-checkbox>
                  <el-checkbox label="牛奶" name="type"></el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <!-- <el-form-item>
                <el-button type="primary" @click="submitForm('editMenuForm')"
                  >确认</el-button
                >
                <el-button @click="resetForm('editMenuForm')">重置</el-button>
              </el-form-item> -->
            </el-form>
          </el-dialog>
          <el-dialog
            title="修改晚餐信息"
            :visible.sync="editMenuDialogVisible3"
            width="400px"
          >
            <el-form
              :model="editMenuForm"
              :rules="rules"
              ref="editMenuForm"
              label-width="100px"
              class="demo-ruleForm"
            >
              <el-form-item hidden>
                <el-input v-model="editMenuForm.zaoCanId"></el-input>
              </el-form-item>
              <el-form-item label="选择菜品" prop="type">
                <el-checkbox-group v-model="wanCans">
                  <el-checkbox label="绿豆粥" name="type"></el-checkbox>
                  <el-checkbox label="红豆粥" name="type"></el-checkbox>
                  <el-checkbox label="八宝粥" name="type"></el-checkbox>
                  <el-checkbox label="牛奶" name="type"></el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <!-- <el-form-item>
                <el-button type="primary" @click="submitForm('editMenuForm')"
                  >确认</el-button
                >
                <el-button @click="resetForm('editMenuForm')">重置</el-button>
              </el-form-item> -->
            </el-form>
          </el-dialog>
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import { time } from 'echarts';
export default {
  name: "FoodManage",
  data() {
    return {
      pages:0,
      pageNum:1,
      tijiao: "处理中..",
      showtijiao: false,
      progress: 0,

//添加菜谱相关
     options: [{
          value: '选项1',
          label: '黄金糕'
        }, {
          value: '选项2',
          label: '双皮奶'
        }, {
          value: '选项3',
          label: '蚵仔煎'
        }, {
          value: '选项4',
          label: '龙须面'
        }, {
          value: '选项5',
          label: '北京烤鸭'
        }],
        zaoCan: [],
        zhongcan:[],
        wancan:[],
      //控制弹窗的出现
      addDishDialogFormVisible: false,
      dialogVisible1: false,
      editDishDialogVisible: false,
      editMenuDialogVisible1: false,
      editMenuDialogVisible2: false,
      editMenuDialogVisible3: false,
      addMenuDialogFormVisible: false,
      //弹窗里什么东西的宽度
      formLabelWidth: "120px",
      //添加菜品的表单
      addDishForm: {
        dishName: "",
        typeName: "",
      },
      //添加菜谱的表单
      addMenuForm: {
        date: "",
        zaoCans: [],
        zhongCans: [],
        wanCans: [],
      },
      //修改菜品的表单
      editDishForm: {
        id: "",
        dishName: "",
        typeName: "",
      },
      //修改菜谱的表单
      editMenuForm: {
        date: "",
        zaoCanId: "",
        zhongCanId: "",
        zwanCanId: "",
        zaoCan: "",
        zhongCan: "",
        wanCan: "",
      },
      //查询条件的表单
      searchForm: {
        dishTypeName: "",
        dishName: "",
        menuDate1: "",
        menuDate2: "",
      },
      //规则
      rules: {
        dishName: [
          { required: true, message: "请输入菜品名称", trigger: "blur" },
        ],

        dishTypeName: [
          { required: true, message: "请选择菜品类型", trigger: "change" },
        ],
        requestDay: [
          { required: true, message: "请输入请假时长", trigger: "blur" },
        ],
      },
      //菜品种类选项
      dishTypeOptions: [
        {
          value: "普通饮食",
          label: "普通饮食",
        },
        {
          value: "软质饮食",
          label: "软质饮食",
        },
        {
          value: "流质饮食",
          label: "流质饮食",
        },
        {
          value: "半流质饮食",
          label: "半流质饮食",
        },
      ],
      //菜品列表
      dishTable: [
        {
          id: 1,
          dishName: "绿豆粥",
          typeName: "半流质饮食",
        },
        {
          id: 2,
          dishName: "红豆粥",
          typeName: "半流质饮食",
        },
        {
          id: 3,
          dishName: "八宝粥",
          typeName: "半流质饮食",
        },
        {
          id: 4,
          dishName: "燕麦",
          typeName: "半流质饮食",
        },
        {
          id: 5,
          dishName: "牛奶",
          typeName: "流质饮食",
        },
      ],
      //菜谱列表

      menuTable: [
      
      ],
    
     
      zaoCans: [
       
      ],
      zhongCans: [],
      wanCans: [],
    };
  },
  created() {
    this.selectMenu();
  },
  methods: {
    tianjiazao: function(values){
 this.zaoCan =values.map(function(obj){
           return obj.value
           })
           console.log("添加的早餐"+this.zaoCan);
    },
    changePageNum : function(currentPage){
				// this.currentPage = currentPage;
				this.selectMenu(currentPage);
    
			},
    selectMenu(pageNum) {
      if(pageNum==0||pageNum==null){
        pageNum=1;
      }
      this.$axios({
        method: "get",
        url: "http://localhost:8090/selectAllMenu",
        params: {
          pageNum: pageNum,
        },
      }).then((res) => {
        this.menuTable=[];
        console.log("数据：", res.data.list);
        let list1 = res.data.list;
        this.pages = parseInt(res.data.pages)*10;
        console.log('------------------------->'+this.pages);
        console.log(res.date);
        console.log(list1.length);
        for (let i = 0; i < 7; i++) {
          var zao =[];
          var zhong =[];
          var wan=[];
          for (let j = 0; j < list1[i].length; j++) {


            if(list1[i][j].times==1){
              zao.push(list1[i][j].dish_name+' ')
            } else if(list1[i][j].times==2){
              zhong.push(list1[i][j].dish_name+' ')
            }else{
              wan.push(list1[i][j].dish_name+' ')
            }

//  date:'8-20',
//          week:'2',
//          zao:[
//            'z1','z2','z3','z4'
//          ],
//          zhong:[
//            'z1','z2','z3','z4'
//          ],
//          wan:[
//            'z1','z2','z3','z4'
//          ],


            console.log("早餐："+zao);
          }
          var week = i+1;
          var date = list1[i][0].date; 
          this.menuTable.push(
            {
              week,
              date,
              zao,zhong,wan
            }
          )
          // this.menuTable.push(xq)
        }
        console.log(this.menuTable[2].zao);
        // console.log("早餐"+this.zaoCans)
      });
    },

    //监听数据
    monitor() {
      // window.setInterval(() => {
      //       setTimeout(fun, 0)
      //   }, 30000)
    },
    //点击提交
    // @click="Submit_application()"
    Submit_application() {
      console.log("点击提交下一周菜谱，等待查验");

      // v-if="showtijiao" 显示下面的提交信息
      this.showtijiao = true;
      this.progress = 1;
      if (this.progress == 1) {
        this.tijiao = "审核通过";
      }
    },

    //提交菜谱，完成本页面
    Submit_recipe() {
      console.log("提交菜谱，完成本页面");
      //提交数据到后台
    },

    //查看
    handleClick(row) {
      console.log(row);
      this.dialogVisible1 = true;
    },
    search() {
      this.$axios({
        method: "get",
        url: "http://localhost:8090/selectAllMenutime",
        params: {
          datet: this.searchForm.menuDate1,
        },
      }).then((res) => {
        console.log(res);
      }),
      console.log(this.searchForm.menuDate1)

    },
    handleClose(done) {
      // this.$confirm('确认关闭？')
      // .then(_ => {
      // 	done();
      // })
      // .catch(_ => {});
      this.dialogVisible1 = false;
    },
    //删除
    del(row) {
      confirm("是否删除" + row.id);
    },
    //删除菜谱
    delMenu(row) {
      confirm("是否删除" + row.date + "这一天的菜谱？");
    },
    //查看原因
    reason(row) {
      confirm("是否删除" + row.id);
    },
    //修改菜品
    editDish(row) {
      console.log(row);
      this.editDishDialogVisible = true;
      this.editDishForm.id = row.id;
      this.editDishForm.dishName = row.dishName;
      this.editDishForm.typeName = row.typeName;
    },
    //修改菜谱
    editZaoMenu(row) {
      console.log(row);
      this.editMenuDialogVisible1 = true;
      this.editMenuForm.zaoCanId = row.zaoCanId;
      this.editMenuForm.zaoCan = row.zaoCan;
    },
    editZhongMenu(row) {
      console.log(row);
      this.editMenuDialogVisible2 = true;
      this.editMenuForm.zhongCanId = row.zhongCanId;
      this.editMenuForm.zhongCan = row.zhongCan;
    },
    editWanMenu(row) {
      console.log(row);
      this.editMenuDialogVisible3 = true;
      this.editMenuForm.wanCanId = row.wanCanId;
      this.editMenuForm.wanCan = row.wanCan;
    },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert("submit!");
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
  },
};
</script>

<style>
.searchform {
  display: flex;
  float: left;
}
.playerinformation .el-button {
  margin-left: 15px;
}
.bg-purple-dark {
  background: #99a9bf;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
  line-height: 36px;
  padding-left: 10px;
}
</style>